(function($) {
	
	$.fn.isRelationship = function(options){
		
		var defaults = {
				isFollow: false
		};
		
		var settings = $.extend({}, defaults, options);
		
		var followFormWrap = $(this),
			navFollowNum = $('#follow-num'),
			peopleFollowNum = $('.follow-num');
		
		return this.each(function(){
			
			$(followFormWrap).isAddOrRemoveFollow({
				
				changeFansNum: true,
				fansNumParentsClass: 'follow-info',
				fansNumType: 'a',
				onAddComplete: function(){
					
					$(navFollowNum).text(parseInt(navFollowNum.text()) + 1);
					
					if(settings.isFollow){
					
						$(peopleFollowNum).text(parseInt(peopleFollowNum.text()) + 1);
					}
				},
				onRemoveComplete: function(){
					
					$(navFollowNum).text(parseInt(navFollowNum.text()) - 1);
					
					if(settings.isFollow){
					
						$(peopleFollowNum).text(parseInt(peopleFollowNum.text()) - 1);
					}
				}
			});
		});
	};
})(jQuery);